<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <!--
      Source generators must target netstandard2.0, which doesn't support nullable reference types. In order
      to enable the nullable reference type compiler checks, we also target NetCoreAppToolCurrent. Note that
      this doesn't use the live shared framework but an LKG targeting pack instead to avoid layering concerns.
    -->
    <TargetFrameworks>netstandard2.0;$(NetCoreAppToolCurrent)</TargetFrameworks>
    <EnableDefaultItems>true</EnableDefaultItems>
    <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
    <UsingToolXliff>true</UsingToolXliff>
    <CLSCompliant>false</CLSCompliant>
    <NoWarn>$(NoWarn);CS0436;CS0649</NoWarn>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <AnalyzerLanguage>cs</AnalyzerLanguage>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisVersion_LatestVS)" PrivateAssets="all" />
  </ItemGroup>

  <ItemGroup>
    <!-- Common generator support -->
    <Compile Include="$(CommonPath)Roslyn\DiagnosticDescriptorHelper.cs" Link="Common\Roslyn\DiagnosticDescriptorHelper.cs" />
    <Compile Include="$(CommonPath)Roslyn\GetBestTypeByMetadataName.cs" Link="Common\Roslyn\GetBestTypeByMetadataName.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Runtime\CompilerServices\IsExternalInit.cs" Link="Common\System\Runtime\CompilerServices\IsExternalInit.cs" />

    <!-- Code included from System.Text.RegularExpressions -->
    <Compile Include="$(CommonPath)System\HexConverter.cs" Link="Production\HexConverter.cs" />
    <Compile Include="$(CommonPath)System\Obsoletions.cs" Link="Common\System\Obsoletions.cs" />
    <Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs" Link="Production\ValueStringBuilder.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Collections\Generic\ValueListBuilder.cs" Link="Production\ValueListBuilder.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Collections\Generic\ValueListBuilder.Pop.cs" Link="Production\ValueListBuilder.Pop.cs" />
    <Compile Include="..\src\System\Threading\StackHelper.cs" Link="Production\StackHelper.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexCaseEquivalences.Data.cs" Link="Production\RegexCaseEquivalences.Data.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexCaseEquivalences.cs" Link="Production\RegexCaseEquivalences.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexCaseBehavior.cs" Link="Production\RegexCaseBehavior.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexCharClass.cs" Link="Production\RegexCharClass.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexFindOptimizations.cs" Link="Production\RegexFindOptimizations.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexNode.cs" Link="Production\RegexNode.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexNodeKind.cs" Link="Production\RegexNodeKind.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexOpcode.cs" Link="Production\RegexOpcode.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexOptions.cs" Link="Production\RegexOptions.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexParseError.cs" Link="Production\RegexParseError.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexParseException.cs" Link="Production\RegexParseException.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexParser.cs" Link="Production\RegexParser.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs" Link="Production\RegexPrefixAnalyzer.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexTree.cs" Link="Production\RegexTree.cs" />
    <Compile Include="..\src\System\Text\RegularExpressions\RegexTreeAnalyzer.cs" Link="Production\RegexTreeAnalyzer.cs" />
    <Compile Include="..\src\System\Collections\HashtableExtensions.cs" Link="Production\HashtableExtensions.cs" />
  </ItemGroup>

  <!-- Don't reference System.Text.RegularExpressions from the LKG, as shared sources are compiled into this project. -->
  <ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppToolCurrent)'">
    <DefaultReferenceExclusion Include="System.Text.RegularExpressions" />
  </ItemGroup>

</Project>
